﻿
/*----------------------------------------------------------------//
// 文件名：MoEmployee.cs
// 文件功能描述：实体 MoEmployee.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoEmployee
using System;
using System.Data;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoEmployee
	/// </summary>
	public partial class MoEmployee:ICloneable
	{
		#region 表Employee的字段
		private string empId;
		private string deptId;
		private string fullname;
		private string sexCode;
		private string idcard;
		private DateTime birthday;
		private string phone;
		private string homeAddr;
		private string rem;
		#endregion
		
		#region 构造函数
		public MoEmployee()
		{
			     birthday=new DateTime(1900,1,1);     	    
		   
		}
		#endregion
		
		#region 拷贝构造函数

		public MoEmployee(MoEmployee item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoEmployee(string empId,string deptId,string fullname,string sexCode,string idcard,DateTime birthday,string phone,string homeAddr,string rem)
		{
		this.empId=empId;
		this.deptId=deptId;
		this.fullname=fullname;
		this.sexCode=sexCode;
		this.idcard=idcard;
		this.birthday=birthday;
		this.phone=phone;
		this.homeAddr=homeAddr;
		this.rem=rem;
		}
		#endregion
		
		#region 表Employee的字段属性
		/// <summary>
		///人员序号。   E0001,E0002
		/// </summary>
		public string EmpId
		{
			get {return empId;}
			set {empId=value;}
		}
		/// <summary>
		/// DEPT_ID
		/// </summary>
		public string DeptId
		{
			get {return deptId;}
			set {deptId=value;}
		}
		/// <summary>
		/// FULLNAME
		/// </summary>
		public string Fullname
		{
			get {return fullname;}
			set {fullname=value;}
		}
		/// <summary>
		/// SEX_CODE
		/// </summary>
		public string SexCode
		{
			get {return sexCode;}
			set {sexCode=value;}
		}
		/// <summary>
		/// IDCARD
		/// </summary>
		public string Idcard
		{
			get {return idcard;}
			set {idcard=value;}
		}
		/// <summary>
		/// BIRTHDAY
		/// </summary>
		public DateTime Birthday
		{
			get {return birthday;}
			set {birthday=value;}
		}
		/// <summary>
		/// PHONE
		/// </summary>
		public string Phone
		{
			get {return phone;}
			set {phone=value;}
		}
		/// <summary>
		/// HOME_ADDR
		/// </summary>
		public string HomeAddr
		{
			get {return homeAddr;}
			set {homeAddr=value;}
		}
		/// <summary>
		/// REM
		/// </summary>
		public string Rem
		{
			get {return rem;}
			set {rem=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoEmployee CopyTo(MoEmployee item)
        {
		    item.empId=this.empId;
		    item.deptId=this.deptId;
		    item.fullname=this.fullname;
		    item.sexCode=this.sexCode;
		    item.idcard=this.idcard;
		    item.birthday=this.birthday;
		    item.phone=this.phone;
		    item.homeAddr=this.homeAddr;
		    item.rem=this.rem;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoEmployee mo=new MoEmployee();
		    mo.EmpId=this.EmpId;
		    mo.DeptId=this.DeptId;
		    mo.Fullname=this.Fullname;
		    mo.SexCode=this.SexCode;
		    mo.Idcard=this.Idcard;
		    mo.Birthday=this.Birthday;
		    mo.Phone=this.Phone;
		    mo.HomeAddr=this.HomeAddr;
		    mo.Rem=this.Rem;
			return mo;
		}
				///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {		 
            if (object.ReferenceEquals(this,obj))
            {
                return true;
            }
            else
            {
                MoEmployee NewEmployee = obj as MoEmployee;
                if (NewEmployee == null)
                {
                    return false;
                }
                else
                {
				if (NewEmployee.EmpId==this.EmpId && NewEmployee.DeptId==this.DeptId && NewEmployee.Fullname==this.Fullname && NewEmployee.SexCode==this.SexCode && NewEmployee.Idcard==this.Idcard && NewEmployee.Birthday==this.Birthday && NewEmployee.Phone==this.Phone && NewEmployee.HomeAddr==this.HomeAddr && NewEmployee.Rem==this.Rem)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format(System.Globalization.CultureInfo.InvariantCulture,"EmpId={0}/DeptId={1}/Fullname={2}/SexCode={3}/Idcard={4}/Birthday={5}/Phone={6}/HomeAddr={7}/Rem={8}",empId,deptId,fullname,sexCode,idcard,birthday,phone,homeAddr,rem);
		 
		}
		#endregion
		
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["Emp_ID"]!=null && row["Emp_ID"]!=DBNull.Value)
			{
			    this.EmpId = (string)row["Emp_ID"];
			}
			else
			{
				this.EmpId =string.Empty;
			}
		    if(row["Dept_ID"]!=null && row["Dept_ID"]!=DBNull.Value)
			{
			    this.DeptId = (string)row["Dept_ID"];
			}
			else
			{
				this.DeptId =string.Empty;
			}
		    if(row["FullName"]!=null && row["FullName"]!=DBNull.Value)
			{
			    this.Fullname = (string)row["FullName"];
			}
			else
			{
				this.Fullname =string.Empty;
			}
		    if(row["Sex_Code"]!=null && row["Sex_Code"]!=DBNull.Value)
			{
			    this.SexCode = (string)row["Sex_Code"];
			}
			else
			{
				this.SexCode =string.Empty;
			}
		    if(row["IDCard"]!=null && row["IDCard"]!=DBNull.Value)
			{
			    this.Idcard = (string)row["IDCard"];
			}
			else
			{
				this.Idcard =string.Empty;
			}
		    if(row["BirthDay"]!=null && row["BirthDay"]!=DBNull.Value)
			{
			    this.Birthday = (DateTime)row["BirthDay"];
			}
			else
			{
				this.Birthday =DateTime.MinValue;
			}
		    if(row["Phone"]!=null && row["Phone"]!=DBNull.Value)
			{
			    this.Phone = (string)row["Phone"];
			}
			else
			{
				this.Phone =string.Empty;
			}
		    if(row["Home_Addr"]!=null && row["Home_Addr"]!=DBNull.Value)
			{
			    this.HomeAddr = (string)row["Home_Addr"];
			}
			else
			{
				this.HomeAddr =string.Empty;
			}
		    if(row["Rem"]!=null && row["Rem"]!=DBNull.Value)
			{
			    this.Rem = (string)row["Rem"];
			}
			else
			{
				this.Rem =string.Empty;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["Emp_ID"] = this.EmpId;
			row["Dept_ID"] = this.DeptId;
			row["FullName"] = this.Fullname;
			row["Sex_Code"] = this.SexCode;
			row["IDCard"] = this.Idcard;
			row["BirthDay"] = this.Birthday;
			row["Phone"] = this.Phone;
			row["Home_Addr"] = this.HomeAddr;
			row["Rem"] = this.Rem;
		}
		#endregion
	}
}
#endregion
